package com.zzq.controller;

import com.zzq.domain.entity.SmilePhotographerDividendRule;
import com.zzq.domain.search.DividendRuleSearchParamet;
import com.zzq.result.SmileResult;
import com.zzq.service.DividendRuleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/dividend/rule")
@Api(value = "摄影师分红规则",tags = {"摄影师分红规则"})
public class PhotographerDividendRuleController {

    @Autowired
    DividendRuleService dividendRuleService;
    @PostMapping("/list")
    @ApiOperation("获取列表")
    public SmileResult list(@RequestBody DividendRuleSearchParamet searchParamet){
      return   dividendRuleService.list(searchParamet);
    }

    @GetMapping("/del")
    @ApiOperation("删除通过ID")
    public SmileResult del(@RequestParam("dividendRuleId") Long dividendRuleId){
        return  dividendRuleService.del(dividendRuleId);
    }

    @PostMapping("/upd")
    @ApiOperation("更新通过ID")
    public SmileResult upd(@RequestBody SmilePhotographerDividendRule dividendRule){
       return dividendRuleService.upd(dividendRule);
    }

    @PostMapping("/add")
    @ApiOperation("添加")
    public SmileResult add(@RequestBody SmilePhotographerDividendRule dividendRule){
        return dividendRuleService.add(dividendRule);
    }





}
